<?php 
include("../include/session.php");
include('../dbconfig.php');
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
   	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    
    <title>Project Anteater Feeder</title>
    
    <link href="../styles/style.css" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
    <!--<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />-->
    
   	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>
	<script src="../lib/jquery-1.6.2.js"></script>
	<script type="text/javascript" src="../jscripts/mootools.js"></script>
    <script type="text/javascript" src="../jscripts/sortableTable.js"></script>
    
    <!--Google Translation-->
    <script>
		function googleTranslateElementInit() {
		  new google.translate.TranslateElement({
			pageLanguage: 'en'
		  });
		}
	</script>
	<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
    
	<!-- This give form a glow on focus -->
	<script type="text/javascript">
		$(document).ready(function(){
			$("input").focus(function() {
				$(this).parent().addClass("curr")
			});
			$("input").blur(function() {
				$(this).parent().removeClass("curr")
			});
		});
    </script>
    
    <!-- Target only Firefox -->
    <style type="text/css">
		@-moz-document url-prefix() 
		{
			form legend { margin:0px;}
			#fieldset legend { margin:0px;}
			#navigation ul li { padding-top:3px; }
			#navigation ul li.current { padding-top:3px; }
			#navigation ul li:hover { padding-top:3px; }
		}
	</style>
</head>
<body>
<div id="wrapper">
    <div id="navigation">
        <ul>
            <li><a href="../index.php">Home</a></li>
            <li><a href="../food_map.php">Food Map</a></li>
            <?php if($session->logged_in)
            {
                /**
                 * User has already logged in, so display relavent links, including
                 * a link to the admin center if the user is an administrator.
                 */?>
                <li <?php if (strpos($_SERVER['PHP_SELF'], '/userinfo.php')) echo 'class="current"';?>><a  <?php echo "href='../userinfo.php?user=$session->username'";?>>My Account</a></li>
                
                <?php if($session->isModerator()){ 
					$result = mysql_query("SELECT * FROM update_queue WHERE modAction='new'");
					$total_results = mysql_num_rows($result);?>
                
                <li <?php if (strpos($_SERVER['PHP_SELF'], '/moderator/')) echo 'class="current"';?>>
                	<a <?php echo "href='moderator.php'";?>>
                    	Moderator Center 
                        <?php if(($total_results > 0) && !(strpos($_SERVER['PHP_SELF'], '/modView.php')) && ((isset($_GET['id'])) && (($_GET['id'] != 1))))
						{
                        echo '<img src="../images/icon_notif.png" style=" margin-right:-15px; margin-top:-4px;" />';
						echo $total_results; }?>
                   	</a>
               	</li>
                <?php } ?>
                <li><a href='../process.php'>Logout</a></li>
            <?php }
            else
            {
                echo "<li><a href='../login.php'>Login</a> or <a href='../register.php'>Register</a></li>";
            }?>
        </ul>
    </div>
    <div id="header"></div>
    <div id="divNav">
    	<ul id="nav">
        	<li <?php if (((isset($_GET['id'])) && ($_GET['id'] == 1)) || (!isset($_GET['id'])) || (strpos($_SERVER['PHP_SELF'], '/modView.php'))) { echo "class='on'"; } ?>><a href="moderator.php?id=1">Main</a>
            	<ul></ul>
            </li>
        </ul>
    </div>